import 'package:easy_read_comic/internal/api/comic_api.dart';
import 'package:get/get.dart';

class IndexController extends GetxController {
  List<String> hotSearch = [];

  @override
  void onInit() {
    super.onInit();
    this.getHotSearchList();
  }

  // getHotSearchList 获取热门搜索
  void getHotSearchList() {
    ComicApi().hotSearch().then((response) {
      if (response.data["code"] == 1) {
        for (var item in response.data["data"]) {
          this.hotSearch.add(item);
        }
        this.update();
      }
    });
  }
}
